﻿#ifndef RMSERVOMANAGER_H
#define RMSERVOMANAGER_H

#include <QObject>

class RmServoManager : public QObject
{
    Q_OBJECT
public:
    explicit RmServoManager(QObject *parent = nullptr);

    const static uint32_t IPIO_GoToOrigin_Up = 0x209600;    //回原点
    const static uint32_t IPIO_ResetFault_Up = 0x209700;    //重置错误
    const static uint32_t IPIO_StartExcute_Up = 0x209800;   //开始执行，与参数指令序号配合使用
    const static uint32_t IPIO_ServoSwitch_uint8 = 0x209900;    //设置私服开关状态
    const static uint32_t IPIO_StopExcute_Up = 0x209A00;    //停止执行
    const static uint32_t IPIO_ExPT0_Up = 0x209D00;     //执行点位0
    const static uint32_t IPIO_SavrParams_Up = 0x20BD00;        //保存参数
    const static uint32_t IPIO_ReadParams_Up = 0x20BE00;    //读取参数
    const static uint32_t IPIO_ReadCommand_Up = 0x20C000;   //读取指令
    const static uint32_t IPIO_SaveCommands_Up = 0x20C900;  //保存所有指令

    const static uint32_t OPIO_ArriveOrigin = 0x20CB00;     //回原点是否执行完成
    const static uint32_t OPIO_Fault = 0x20CC00;    //报警错误
    const static uint32_t OPIO_PulseInPlace = 0x20CD00;     //脉冲到位
    const static uint32_t OPIO_CommandInPlace = 0x20CE00;   //指令到位
    const static uint32_t OPIO_Excuting = 0x20CF00;     //运动中
    const static uint32_t OPIO_ArrivePT0 = 0x20D000;    //到达点位0

    const static uint32_t RO_CommandNo_int32 = 0x20FB00;    //指令序号
    const static uint32_t RO_CurrentSpeed_float = 0x300100;    //当前速度
    const static uint32_t RO_Fault_int32 = 0x300300;    //错误代码
    const static uint32_t RO_CurrentTorque_float = 0x200300;    //当前扭矩
    const static uint32_t RO_CurrentPosition_float = 0x300000;    //当前位置
    const static uint32_t RO_CurrentStrength_float = 0x300800;    //当前出力

    const static uint8_t Fault_Normal = 0;
    const static uint8_t Fault_GeneralError = 1;
    const static uint8_t Fault_OutOfPhase = 2;
    const static uint8_t Fault_OutOfPosition = 3;
    const static uint8_t Fault_OutOfSpeed = 4;
    const static uint8_t Fault_Stalling = 5;
    const static uint8_t Fault_Excitation = 6;

signals:

};

#endif // RMSERVOMANAGER_H
